/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseWorkFlowCurrentEntity.cs
*        创建系统时间:       2012/11/2 19:07:03
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;

    [Serializable]
    public class BaseWorkFlowCurrentEntity
    {
        public string AuditDepartmentFullName;
        public string AuditDepartmentID;
        public string AuditIdea;
        public string AuditState;
        public string AuditUserFullName;
        public string AuditUserID;
        public string CategoryFullName;
        public string CategoryID;
        public string CreateDate;
        public string CreateUserFullName;
        public string CreateUserID;
        public string Description;
        public int Enabled;
        public string FlowID;
        public string ID;
        public string ModifyDate;
        public string ModifyUserFullName;
        public string ModifyUserID;
        public string ObjectFullName;
        public string ObjectID;
        public string SortCode;
        public string StepID;

        public BaseWorkFlowCurrentEntity()
        {
            this.ID = string.Empty;
            this.StepID = string.Empty;
            this.FlowID = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.CategoryID = string.Empty;
            this.CategoryFullName = string.Empty;
            this.ObjectID = string.Empty;
            this.ObjectFullName = string.Empty;
            this.SortCode = string.Empty;
            this.Enabled = 1;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyUserFullName = string.Empty;
            this.ModifyDate = string.Empty;
        }

        public BaseWorkFlowCurrentEntity(DataRow dataRow)
        {
            this.ID = string.Empty;
            this.StepID = string.Empty;
            this.FlowID = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.CategoryID = string.Empty;
            this.CategoryFullName = string.Empty;
            this.ObjectID = string.Empty;
            this.ObjectFullName = string.Empty;
            this.SortCode = string.Empty;
            this.Enabled = 1;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyUserFullName = string.Empty;
            this.ModifyDate = string.Empty;
            this.GetFrom(dataRow);
        }

        public BaseWorkFlowCurrentEntity(DataTable dataTable)
        {
            this.ID = string.Empty;
            this.StepID = string.Empty;
            this.FlowID = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.CategoryID = string.Empty;
            this.CategoryFullName = string.Empty;
            this.ObjectID = string.Empty;
            this.ObjectFullName = string.Empty;
            this.SortCode = string.Empty;
            this.Enabled = 1;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyUserFullName = string.Empty;
            this.ModifyDate = string.Empty;
            this.GetFrom(dataTable);
        }

        public void ClearProperty()
        {
            this.ID = string.Empty;
            this.StepID = string.Empty;
            this.FlowID = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.CategoryID = string.Empty;
            this.CategoryFullName = string.Empty;
            this.ObjectID = string.Empty;
            this.ObjectFullName = string.Empty;
            this.SortCode = string.Empty;
            this.Enabled = 1;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyUserFullName = string.Empty;
            this.ModifyDate = string.Empty;
        }

        public BaseWorkFlowCurrentEntity GetFrom(DataRow dataRow)
        {
            this.ID = dataRow[BaseWorkFlowCurrentTable.FieldID].ToString();
            this.StepID = dataRow[BaseWorkFlowCurrentTable.FieldStepID].ToString();
            this.FlowID = dataRow[BaseWorkFlowCurrentTable.FieldFlowID].ToString();
            this.AuditUserID = dataRow[BaseWorkFlowCurrentTable.FieldAuditUserID].ToString();
            this.AuditUserFullName = dataRow[BaseWorkFlowCurrentTable.FieldAuditUserFullName].ToString();
            this.AuditDepartmentID = dataRow[BaseWorkFlowCurrentTable.FieldAuditDepartmentID].ToString();
            this.AuditDepartmentFullName = dataRow[BaseWorkFlowCurrentTable.FieldAuditDepartmentFullName].ToString();
            this.AuditIdea = dataRow[BaseWorkFlowCurrentTable.FieldAuditIdea].ToString();
            this.AuditState = dataRow[BaseWorkFlowCurrentTable.FieldAuditState].ToString();
            this.CategoryID = dataRow[BaseWorkFlowCurrentTable.FieldCategoryID].ToString();
            this.CategoryFullName = dataRow[BaseWorkFlowCurrentTable.FieldCategoryFullName].ToString();
            this.ObjectID = dataRow[BaseWorkFlowCurrentTable.FieldObjectID].ToString();
            this.ObjectFullName = dataRow[BaseWorkFlowCurrentTable.FieldObjectFullName].ToString();
            this.SortCode = dataRow[BaseWorkFlowCurrentTable.FieldSortCode].ToString();
            this.Enabled = int.Parse(dataRow[BaseWorkFlowCurrentTable.FieldEnabled].ToString());
            this.Description = dataRow[BaseWorkFlowCurrentTable.FieldDescription].ToString();
            this.CreateUserID = dataRow[BaseWorkFlowCurrentTable.FieldCreateUserID].ToString();
            this.CreateUserFullName = dataRow[BaseWorkFlowCurrentTable.FieldCreateUserFullName].ToString();
            this.CreateDate = dataRow[BaseWorkFlowCurrentTable.FieldCreateDate].ToString();
            this.ModifyUserID = dataRow[BaseWorkFlowCurrentTable.FieldModifyUserID].ToString();
            this.ModifyUserFullName = dataRow[BaseWorkFlowCurrentTable.FieldModifyUserFullName].ToString();
            this.ModifyDate = dataRow[BaseWorkFlowCurrentTable.FieldModifyDate].ToString();
            return this;
        }

        public BaseWorkFlowCurrentEntity GetFrom(DataTable dataTable)
        {
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }
    }
}